//数据资源目录
config = {
	TAB : {
		filter:[ 
		         {type:'tree',name:'标准目录',code:'rulecode',storesql:"select distinct rulecode code,rulename name,parentcode from metadb_struct where dbname='stdcat'",where:"topiccode like '{selfval}%'"}
				,{type:'label',name:'数据库',code:'dbname',storesql:"select distinct dbname,cnname from metadb_list",where:"dbname in('{selfval}')"}
				,{type:'label',name:'热点词',code:'DIM_DATALEVEL',storesql:"客户,用户,帐户,资费,大客户,VPMN,积分,订单,工单,咨询受理",where:"datacnname in('{selfval}')"}
				,{type:'label',name:'表大小',code:'rownum_val',storesql:"小表,100万,100-1000万,1000-5000万,5000万-3亿,3亿-10亿,超大表",where:"level_val in('{selfval}')"}
			],
		toolbar:[
		         {type:'button',fieldLabel:'导出',width:120,actionId:'exportTAB',name:'exportTAB'}
		         ],
		list:{
			title: '模型',
			sql : "select XMLID,'TAB' OBJTYPE,DATANAME,DATACNNAME,DBNAME,TOPICCODE,TOPICNAME,TEAM_CODE,CREATER,CURDUTYER,CYCLETYPE,ROWNUM_VAL,FIELDNUM,STATE_DATE,STATE,REMARK,OPEN_STATE from tablefile ",
			tpl:'<div class="dacptiles panel panel-success " id="{{XMLID}}" title="{{DATANAME}}" objtype="TAB"><header class="panel-heading"><span class="part-one">{{CYCLECNTYPE}} </span><span class="part-two">{{DBCNNAME}}</span><ul class="nav nav-pills pull-right"></ul></header><div class="row"><div class="col-md-12" style="padding-left:30px;text-align:left;"><h5><b>{{DATANAME}}<b></b></b></h5><b><b><small><b>{{DATACNNAME}}&nbsp;</b></small></b></b></div></div><div class="row fieldinfo"></div><div class="panel-footer bg-light lter text-center" style="margin-top:10px"><div class="row pull-out"><div class="col-xs-4"><div class="padder-v"><span class="m-b-xs h5 block">{{FIELDCNNUM}}</span><small class="text-muted">字段数</small></div></div><div class="col-xs-4 dk"><div class="padder-v"><span class="m-b-xs h5 block">{{ROWNUM_CNVAL}}</span><small class="text-muted">记录数</small></div></div><div class="col-xs-4"><div class="padder-v"> <a href="#" class="metaaction red" actid="publishData"> <span class="m-b-xs h5 block"><span class="glyphicon glyphicon glyphicon-bullhorn"></span></span><small class="text-muted red">发布数据</small></a></div></div></div></div></div>',
			columns : [
				{
					header : "数据库",
					dataIndex : 'DBNAME',
					headerAlign : "center",
					dataAlign : "center",
					width : "80%",
					sortable : true,
					render : function(rowData, colVal) {
						var html = '<div class="media">'
								+ '<div class="media-left">'
								+ '<a href="#">'
								+ '    <img class="media-object" alt="" src="/'
								+ contextPath
								+ '/dacp-res/catalog/common/images/database/table.png" style="width: 60px; height: 40px;">'
								+ '  </a>'
								+ '</div>'
								+ '<div class="media-body">'
								+ '  <h4 class="media-heading"><a href="#">'
								+ rowData.DATANAME.toLowerCase()
								+ ","
								+ rowData.DATACNNAME
								+ '</a></h4>'
								+ '  <p><code>位置:'
								+ colVal
								+ '&nbsp;&nbsp;</code>,创建团队:'+rowData.TEAM_CODE+',主题：'+(rowData.TOPICNAME||'--')+',<a type="button" class="btn btn-primary btn-xs pull-right" onclick="$(this).dblclick();">详细信息</a>	</p>'
								+ '  <p class="text-muted m-t-sm small">'+(rowData.REMARK||'无详细信息')+'</p>'
								+ '<div class="text-muted"> <i class="fa fa-user icon-muted"></i> by <a href="#" class="m-r-sm">' + (rowData.CURDUTYER||'--') + '</a> <i class="fa fa-clock-o icon-muted"></i>' + rowData.STATE_DATE + '<a href="#" class="m-l-sm"><i class="fa fa-comment-o icon-muted"></i> no comments</a> </div>'
								+ '</div>'
								+ '</div>';
						return html;
					}
				}
			],
			getDetailInfo: function(xmlid) {
				var coldata = ai.getStoreData("select colname,colcnname from column_val where xmlid='"+xmlid+"' order by col_seq");
				var html="";
				for(var i=0;i<coldata.length;i++){
					html+='<div class="col-xs-6"><small pull-left"> <i class="fa fa-clock-o"></i> '+coldata[i].COLNAME.toLowerCase()+","+coldata[i].COLCNNAME+'</small></div> ';
					if(i>=18){
					  html+='<div class="col-xs-6"><a href="#" id="getMoreDetail"><span class="label label-primary pull-left">查看更多>></span></a></div>';
					  break;
					}
				};
				return html; 
			},
			publishData:function(xmlid){
				var _url="/me/ftl/me/dataos/index?firstpage=";
				 _url+=encodeURIComponent("/me/ftl/datastore/tabPublishMgr?xmlid="+xmlid);
				 window.open(_url); 
				//ai.addTabSheet(xmlid,xmlid,"/me/ftl/datastore/tabPublishMgr?xmlid="+xmlid)
				//alert(xmlid);
			}
		}
	}
}